Function Reference
ReplaceAllInFile
Replaces strings in a text file with the specified input encoding and writes the result to the output path with the same encoding.
Note: Not a replacement for using page templates when possible.
Syntax:
wwmultisearchreplaceextension:ReplaceAllInFile($inputEncodingAsString, $inputFilePath, $outputFilePath, $replacements)
wwmultisearchreplaceextension:ReplaceAllInFile($inputEncodingAsString, $inputFilePath, $outputEncodingAsString, $outputFilePath, $replacements)Parameters:
Name | Type | Description |
|---|---|---|
inputEncodingAsString | string | The input encoding as string. |
inputFilePath | string | Full pathname of the input file. |
outputFilePath | string | Full pathname of the output file. |
replacements | object | The replacements in a node set. |
outputEncodingAsString | string | The output encoding as string. |
ReplaceAllInString
Replaces strings in the given string and returns the result. Using this method is much faster than performing multiple search/replace calls in XSL substring methods.
Syntax:
wwmultisearchreplaceextension:ReplaceAllInString($input, $replacements)Parameters:
Name | Type | Description |
|---|---|---|
input | string | The input. |
replacements | object | The replacements in a node-set. |
Returns:
string: A string.Example:
<xsl:variable name="VarReplacementsAsXML">
<wwmultisere:entry match="&" replacement="&" xmlns:wwmultisere="urn:WebWorks-XSLT-Extension-MultiSearchReplace" />
<wwmultisere:entry match="<" replacement="<" xmlns:wwmultisere="urn:WebWorks-XSLT-Extension-MultiSearchReplace" />
</xsl:variable>
<xsl:variable name="VarReplacements" select="msxsl:node-set($VarReplacementsAsXML)/*" />
<xsl:variable name="VarResult" select="wwmultisere:ReplaceAllInString($VarInput, $VarReplacements)" />Last modified date: 01/12/2026